package com.example.aigc_education.enums;

import lombok.Getter;

@Getter
public enum ThemeCompletionStatus {


    NOT_STARTED("not-started", 0,"#9E9E9E"),
    IN_PROGRESS("in-progress", 1,"#FFB300"),
    COMPLETED("completed", 2,"#43A047");

    private final String title;

    private final int value;

    private final String color;

    ThemeCompletionStatus(String title, int value,String color) {
        this.title = title;
        this.value = value;
        this.color = color;
    }

    public static ThemeCompletionStatus fromValue(int value) {
        for (ThemeCompletionStatus themeCompletionStatus : ThemeCompletionStatus.values()) {
            if (themeCompletionStatus.getValue() == value) {
                return themeCompletionStatus;
            }
        }
        throw new IllegalArgumentException("No enum constant with value " + value);
    }
    public static ThemeCompletionStatus fromTitle(String title) {
        for (ThemeCompletionStatus themeCompletionStatus : ThemeCompletionStatus.values()) {
            if (themeCompletionStatus.getTitle().equals(title)) {
                return themeCompletionStatus;
            }
        }
        throw new IllegalArgumentException("No enum constant with title " + title);
    }
}
